<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<?php $is_home = ($this->uri->uri_string() == '' || $this->uri->uri_string() ==  $this->system->page_home) ; ?>

	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title><?php if (!empty($title)):?><?php echo $title?> - <?php endif;?><?php echo $this->system->site_name?></title>
	<meta name="keywords" content="<?php if (!empty($meta_keywords)):?><?php echo $meta_keywords?> - <?php endif; ?><?php echo $this->system->meta_keywords;?>" />
	<meta name="description" content="<?php if (!empty($meta_description)):?><?php echo $meta_description?> - <?php endif; ?><?php echo $this->system->meta_description;?>" />
	<meta name="robots" content="index,follow" />
	<link rel="shortcut icon" href="<?php echo base_url()?>application/views/<?php echo $this->system->theme_dir . $this->system->theme ?>/images/favicon.ico" type="image/x-icon" />
	<link rel="alternate" type="text/xml" title="RSS 2.0" href="http://feeds.feedburner.com/serasera/tononkira" />
	<link rel="stylesheet" href="<?php echo base_url()?>application/views/<?php echo $this->system->theme_dir . $this->system->theme ?>/style/stylesheet.css?v=201210191107" type="text/css" media="screen" charset="utf-8" />
    <link rel="stylesheet" type="text/css" media="print" href="<?php echo base_url()?>application/views/<?php echo $this->system->theme_dir . $this->system->theme ?>/style/print.css" />
	<!--[if IE]>
		<link rel="stylesheet" href="<?php echo base_url()?>application/views/<?php echo $this->system->theme_dir . $this->system->theme ?>/style/iefix.css" type="text/css" media="screen" charset="utf-8" />
	<![endif]-->
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
	<?php /* <script src="<?php echo base_url()?>application/views/<?php echo $this->system->theme_dir . $this->system->theme ?>/javascript/jquery.cookie.js" type="text/javascript"></script> */ ?>
    <script type="text/javascript" src="<?php echo base_url()?>application/views/<?php echo $this->system->theme_dir . $this->system->theme ?>/javascript/hoverIntent.js"></script>
    <script type="text/javascript" src="<?php echo base_url()?>application/views/<?php echo $this->system->theme_dir . $this->system->theme ?>/javascript/superfish.js"></script>

	<script src="<?php echo base_url()?>application/views/<?php echo $this->system->theme_dir . $this->system->theme ?>/javascript/sitelib.js?v=2013062601" type="text/javascript"></script>
	<script src="<?php echo base_url()?>application/views/<?php echo $this->system->theme_dir . $this->system->theme ?>/javascript/external.js" type="text/javascript"></script>

    <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>application/views/<?php echo $this->system->theme_dir . $this->system->theme ?>/style/superfish.css" media="screen">
    <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>application/views/<?php echo $this->system->theme_dir . $this->system->theme ?>/style/superfish-navbar.css" media="screen">

    <script type="text/javascript">

    // initialise plugins
    jQuery(function(){
        jQuery('ul.sf-menu').superfish({pathClass:  'current'});
    });

    $(document).ready(function () {
        $('form :input:visible:first').focus();
    });
    </script>
    <?php if($is_home): ?>
 	<script src="<?php echo base_url()?>application/views/<?php echo $this->system->theme_dir . $this->system->theme ?>/javascript/jquery.zrssfeed.min.js" type="text/javascript"></script>
	<?php /*
    <script type="text/javascript">
$(document).ready(function () {
  $('#left').rssfeed('http://code.google.com/feeds/p/adozioni/gitchanges/basic', {
    limit: 10,
    content: false
  });
});
</script>
*/ ?>

   
    <?php endif; ?>
   <?php $this->plugin->do_action('header');?>

</head>

<body class='body_bg'>

<div id="wrapper" align="center">
	<div id="header">
		<div id="logo">
		<a href="<?php echo base_url()?>"><?php echo $this->system->site_name?></a>
		</div>
		
	</div>
	<div id="topmenu">
	<!-- left -->
			<?php if ($rows = $this->block->get('adozioni_menu')) : ?>
<?php
$i = 1;
$output = "<ul class='sf-menu sf-navbar sf-js-enabled sf-shadow'>";
$extra = array();
while(isset($rows[$i]))
{
    $output .= "<li ";
    if(strpos($rows[$i]['url'], $this->uri->segment(2))) $output .= 'class="current"';
    $output .= " ><a href='" . $rows[$i]['url'].  "'>"  . $rows[$i]['text'] . "</a>";
    $j = 0;
    if(isset($rows[$i][$j]))
    {
        $output .= "<ul>";
        while (isset($rows[$i][$j]))
        {   
            $output .= "<li ";
            if($this->uri->segment(3) && strpos($rows[$i][$j]['url'], $this->uri->segment(2).'/'.$this->uri->segment(3))) $output .= 'class="current"';
            $output .= "><a href='"  . $rows[$i][$j]['url'] . "'>" .  $rows[$i][$j]['text'] . "</a>";
            $k = 0;
            if(isset($rows[$i][$j][$k]))
            {
                
                while (isset($rows[$i][$j][$k]))
                {
					//$index = strpos($rows[$i][$j][$k]['url'], '/', 7); 
					if($this->uri->segment(3) && strpos($rows[$i][$j]['url'], $this->uri->segment(2).'/'.$this->uri->segment(3)))
					//if($this->uri->segment(3) && strpos($rows[$i][$j][$k]['url'], $this->uri->segment(2).'/'.$this->uri->segment(3)) !== false)
					{
						$extra[] = "<a href='"  . $rows[$i][$j][$k]['url'] . "'>" .    $rows[$i][$j][$k]['text'] . "</a>";
					}
                    $k++;
                }
            }
            $j++;
            $output .= "</li>";
        }
        $output .= "</ul>";
    }
    $output .= "</li>";
    $i++;
}
$output .= "</ul>";            
echo $output;
?>
		<?php endif; ?>
	</div>
	
<div id="page">
    <div class="noprint">
    <?php if(!empty($extra)) echo join(' | ', $extra); ?> 
	</div>
    
    <?php if ($is_home) : ?>
    
	<div id="left">

		
		
			
			<div id="left-left">

<!-- news in -->
<?php /*if ( $rows = $this->block->get('rss_block', array('limit' => 20, 'url' => 'http://code.google.com/feeds/p/adozioni/gitchanges/basic'))) :?>
			<div id='newsbox'>
					<div>
				<h1><?php echo __("Ultime modifiche sul programma", 'ado_view')?></h1>
						<ul>
					<?php $i = 0; foreach ($rows as $item): ?>

						<li><?php echo $item->get_date() ?>: <?php echo substr($item->get_title(), strpos($item->get_title(), ':') + 2); ?></li>
					<?php $i++; endforeach; ?>
						</ul>
						<?php echo "<a href='http://code.google.com/p/adozioni/source/list'>continua...</a>"; ?>
						<div class="clear"></div>
					
					</div>
				</div>
<?php endif; */ ?>				
<!-- news out-->		


		
				

				
				
				
			</div>
		
		</div>	
		<div id="right">
			<?php if ($notice = $this->session->flashdata('notification')):?>
			<p class="notice">
			<?php echo $notice;?>
			</p>
			<?php endif;?>
			<div id="login">
				<?php if(!$this->user->logged_in) : ?>
				

				<form id="homelogin" name="login" method="post" class="homelogin" action="<?php echo site_url('member/login') ?>">
				<input id="username" name="username" title="<?php echo __("Username:", "ado_view")?>" value="<?php echo __("Username:", "ado_view")?>" class="input-text" type="text">
				<input id="password" name="password" title="<?php echo __("Password:", "ado_view")?>" type="password" value="<?php echo __("Password:", "ado_view")?>"class="input-text">
				<input name="submit" value=" <?php echo __("Go", "ado_view")?> " class="input-submit" type="submit">
				<input type="hidden" name="redirect" value="<?php echo site_url() ?>">				
				</form>
				<a href="<?php echo $this->user->lang ?><?php echo site_url('member/adino') ?>"><?php echo __("Dimentica password?", "ado_view")?></a>
				<?php else : ?>
				<?php echo __("Logged in:", "ado_view") . " " . $this->user->username ?><br />
				<a href="<?php echo site_url('member/profile') ?>"><?php echo __("Cambia password", "ado_view")?></a> | <a href="<?php echo site_url('member/logout') ?>"><?php echo __("Sign out", "ado_view") ?></a>
				<?php endif; ?>
				</div>
				
				

			</div>
			
			
			
			<div id="right-bar">
			
				<?php if ($rows = $this->block->get('tononkira_latest_momba', array('limit' => 5))) : ?>
				<div class="box-gris">
					<h1><?php echo __("Ultime offerte", "ado_view") ;?></h1>
					<?php foreach ($rows as $h): ?>

					<div class="clear"><a src="http://avatar.serasera.org"><img src="http://avatar.serasera.org/<?php echo md5($h['submitter']) ?>.jpg" width="48" height="48" border="0" align="left" class="avatar" vspace="5" hspace="5"></a> <a href="<?php echo site_url('tononkira/hevitra/mpihira/' . $h['mpihiraid']) ?>" style="text-decoration: none"><?php echo substr(strip_tags($h['mombamomba']), 0, 50)?>...</a></div>
					
					
					<?php endforeach;?>
				</div>
				<?php endif; ?>



				<?php if ($rows = $this->block->get('tononkira_latest_hira')) : ?>
				<div class="box-gris">
					<h1><?php echo __("Tononkira vao tonga", "ado_view") ;?></h1>
					<ul>
					<?php $i = 1; foreach ($rows as $row): ?>
					<li><?php echo $i . ". <a href=" .  site_url('hira/' . $row['uri'])  . ">" . $row['lohateny'] . "</a> (" . $row['anarana'] . ")" ?></li>
					<?php $i++; endforeach;?>
					</ul>
				</div>
				<?php endif; ?>


				<?php if ($rows = $this->block->get('tononkira_latest_tabs')) : ?>
				<div class="box-gris">
					<h1><?php echo __("Tondrom-peo vao tonga", "ado_view") ;?></h1>
					<ul>
					<?php $i = 1; foreach ($rows as $row): ?>
					<li><?php echo $i . ". <a href=" .  site_url('tononkira/tabs/asehoy/' . $row['id'])  . ">" . $row['lohateny'] . "</a> " ;?></li>
					<?php $i++; endforeach;?>
					</ul>
				</div>
				<?php endif; ?>



				
				
				

				<?php if ($rows = $this->block->get('tononkira_top_hira')) : ?>
				<div class="box-gris">
					<h1><?php echo __("Hira be mpijery", "ado_view") ;?></h1>
					<ul>
					<?php $i = 1; foreach ($rows as $row): ?>
					<li><?php echo $i . ". <a href=" .  site_url('hira/' . $row['uri'])  . ">" . $row['lohateny'] . "</a> (" . $row['vangy'] . ")" ;?></li>
					<?php $i++; endforeach;?>
					</ul>
				</div>
				<?php endif; ?>
		
				<?php if ($rows = $this->block->get('tononkira_top_mpihira')) : ?>
				<div class="box-gris">
					<h1><?php echo __("Mpihira be mpijery", "ado_view") ;?></h1>
					<ul>
					<?php $i = 1; foreach ($rows as $row): ?>
					<li><?php echo $i . ". <a href=" .  site_url('mpihira/' . $row['uri'])  . ">" . $row['anarana'] . "</a> (" . $row['vangy'] . ")" ;?></li>
					<?php $i++; endforeach;?>
					</ul>
				</div>
				<?php endif; ?>
		


			</div>

		</div>
	<?php else: ?>

	
	<div id="content">
	
		<div id="main">
			<?php $this->load->view('../modules/' . $module . '/views/' . $view); ?>
		</div>
	
	</div>
	<?php endif; ?> 
	<div id="footer">
	
	</div>
</div>
<div id="copyright">
<!--Concept and Design &copy; Serasera.org: <a href="http://hery.serasera.org">Eugene Hery</a> <img src="http://serasera.org/images/seraserapowered.gif" width="80" height="15" /> Tel +39 338 744 2412 (Italie) -->
<br />Page rendered in {elapsed_time} seconds</p>
</div>
</body>
</html>